package com.zlzxm.lock;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.widget.Toast;

/**
 * Created by zlz
 * on  2019-10-14
 */
public class ScreenReceiver extends BroadcastReceiver {


    @Override
    public void onReceive(Context context, Intent intent) {

        String action =intent.getAction();

        if("android.intent.action.SCREEN_OFF".equals(action)){



        }else if("android.intent.action.SCREEN_ON".equals(action)){


            Intent intentLock = new Intent(context,LockActivity.class);
            intentLock.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            context.startActivity(intentLock);


        }

    }
}
